{% extends 'base_account.html' %}

{% load url from future %}
{% load i18n %}

{% block head_title %}Change Password{% endblock head_title %}
{% block page_title %}Change Password{% endblock page_title %}

{% block content %}
{% if token_fail %}
    {% url 'account_reset_password' as passwd_reset_url %}
    <p class="alert alert-error">{% blocktrans %}The password reset link was invalid, possibly because it has already been used.  Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
{% else %}
<div class="row">
    <div class="col-sm-6">
        {% if form %}
            <form method="POST" action="" class="uniForm">
                {% csrf_token %}
                <div class="form-group">
                    <label for="id_password1">New Password:</label>
                    <input id="id_password1" name="password1" placeholder="Password" type="password" class="form-control" autofocus>
                </div>
                <div class="form-group">
                    <label for="id_password2">New Password (again):</label>
                    <input id="id_password2" name="password2" placeholder="Password" type="password" class="form-control">
                </div>
                <input type="submit" class="btn btn-primary margin-top" name="action" value="{% trans "Set new password" %}"/>
            </form>
        {% else %}
            <p>{% trans 'Your password is now changed.' %}</p>
            <p><a href="{% url 'account_login' %}">Sign In</a></p>
        {% endif %}
    </div>
    {% endif %}
</div>
{% endblock %}
